package com.jgame.secondarymarket.application.service.product;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jgame.secondarymarket.domain.product.entity.Specification;
import com.jgame.secondarymarket.domain.product.service.SpecificationService;
import com.jgame.secondarymarket.interfaces.query.page.product.PageSpecificationQuery;
import com.jgame.secondarymarket.interfaces.vo.product.SpecificationVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @title: SpecificationApplicationService
 * @Author Wangsj
 * @Date: 2021/7/23
 */
@Service
public class SpecificationApplicationService {
    @Autowired
    SpecificationService specificationService;

    public void delById(Long productId, List<Long> specificationId) {
        specificationService.delById(productId, specificationId);
    }

    public void add(Long productId, List<Specification> specifications) {
        specificationService.add(productId, specifications);
    }

    public void update(Long productId, Long specificationId, Specification specification) {
        specificationService.update(productId, specificationId, specification);
    }

    public SpecificationVO getOneById(Long productId, String properties) {
        return specificationService.getOneById(productId, properties);
    }

    public IPage<SpecificationVO> getPage(PageSpecificationQuery query) {
        return specificationService.getPage(query);
    }
}
